package com.sunyard.ebina;

import com.sunyard.ebina.service.CardealerInfoTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication(scanBasePackages = {"com.sunyard.ebina"})
@ImportResource({"classpath*:/dubbo/dubbo-all.xml"})
@RestController
public class EbinaApplication {

	CardealerInfoTestService cardealerInfoTestService;

	@Autowired
	public EbinaApplication(CardealerInfoTestService cardealerInfoTestService) {
		this.cardealerInfoTestService = cardealerInfoTestService;
	}

	@GetMapping("/cardealer/detail")
	public Object getCardealerInfo(Long id) {
		return cardealerInfoTestService.getCardealerInfo(id);
	}

	public static void main(String[] args) {
		SpringApplication.run(EbinaApplication.class, args);
	}
}
